3D Graphics Programming with QuickDraw 3D 1.5.4

Previous | QD3D Book | Overview | Chapter Contents | Next

Creating and Editing NURB Curves

QuickDraw 3D provides routines that you can use to create and manipulate NURB curves. See "NURB Curves" for the definition of a NURB curve.

Q3NURBCurve_New

You can use the Q3NURBCurve_New function to create a new NURB curve.

TQ3GeometryObject Q3NURBCurve_New (const TQ3NURBCurveData *curveData);
curveData
A pointer to a TQ3NURBCurveData structure.

DESCRIPTION

The Q3NURBCurve_New function returns, as its function result, a new NURB curve having the shape and attributes specified by the curveData parameter. If a new NURB curve could not be created, Q3NURBCurve_New returns the value NULL .

Q3NURBCurve_Submit

You can use the Q3NURBCurve_Submit function to submit an immediate NURB curve for drawing, picking, bounding, or writing.

TQ3Status Q3NURBCurve_Submit (
                     const TQ3NURBCurveData *curveData,
                     TQ3ViewObject view);
curveData
A pointer to a TQ3NURBCurveData structure.
view
A view.

DESCRIPTION

The Q3NURBCurve_Submit function submits for drawing, picking, bounding, or writing the immediate NURB curve whose shape and attribute set are specified by the curveData parameter. The NURB curve is drawn, picked, bounded, or written according to the view characteristics specified in the view parameter.

SPECIAL CONSIDERATIONS

You should call this function only in a submitting loop.

Q3NURBCurve_GetData

You can use the Q3NURBCurve_GetData function to get the data that defines a NURB curve and its attributes.

TQ3Status Q3NURBCurve_GetData (
                     TQ3GeometryObject curve,
                     TQ3NURBCurveData *nurbCurveData);
curve
A NURB curve.
nurbCurveData
On exit, a pointer to a TQ3NURBCurveData structure that contains information about the NURB curve specified by the curve parameter.

DESCRIPTION

The Q3NURBCurve_GetData function returns, through the nurbCurveData parameter, information about the NURB curve specified by the curve parameter. QuickDraw 3D allocates memory for the TQ3NURBCurveData structure internally; you must call Q3NURBCurve_EmptyData to dispose of that memory.

Q3NURBCurve_SetData

You can use the Q3NURBCurve_SetData function to set the data that defines a NURB curve and its attributes.

TQ3Status Q3NURBCurve_SetData (
                     TQ3GeometryObject curve,
                     const TQ3NURBCurveData *nurbCurveData);
curve
A NURB curve.
nurbCurveData
A pointer to a TQ3NURBCurveData structure.

DESCRIPTION

The Q3NURBCurve_SetData function sets the data associated with the NURB curve specified by the curve parameter to the data specified by the nurbCurveData parameter.

Q3NURBCurve_EmptyData

You can use the Q3NURBCurve_EmptyData function to release the memory occupied by the data structure returned by a previous call to Q3NURBCurve_GetData .

TQ3Status Q3NURBCurve_EmptyData (TQ3NURBCurveData *nurbCurveData);
nurbCurveData
A pointer to a TQ3NURBCurveData structure.

DESCRIPTION

The Q3NURBCurve_EmptyData function releases the memory occupied by the TQ3NURBCurveData structure pointed to by the nurbCurveData parameter; that memory was allocated by a previous call to Q3NURBCurve_GetData .

Q3NURBCurve_GetControlPoint

You can use the Q3NURBCurve_GetControlPoint function to get a four-dimensional control point for a NURB curve.

TQ3Status Q3NURBCurve_GetControlPoint (
                     TQ3GeometryObject curve,
                     unsigned long pointIndex,
                     TQ3RationalPoint4D *point4D);
curve
A NURB curve.
pointIndex
An index into the controlPoints array of control points for the specified NURB curve.
point4D
On exit, the control point having the specified index in the controlPoints array of control points for the specified NURB curve.

DESCRIPTION

The Q3NURBCurve_GetControlPoint function returns, in the point4D parameter, the four-dimensional control point of the NURB curve specified by the curve parameter having the index in the array of control points specified by the pointIndex parameter.

Q3NURBCurve_SetControlPoint

You can use the Q3NURBCurve_SetControlPoint function to set a four-dimensional control point for a NURB curve.

TQ3Status Q3NURBCurve_SetControlPoint (
                     TQ3GeometryObject curve,
                     unsigned long pointIndex,
                     const TQ3RationalPoint4D *point4D);
curve
A NURB curve.
pointIndex
An index into the controlPoints array of control points for the specified NURB curve.
point4D
The desired four-dimensional control point.

DESCRIPTION

The Q3NURBCurve_SetControlPoint function sets the four-dimensional control point of the NURB curve specified by the curve parameter having the index in the array of control points specified by the pointIndex parameter to the point specified by the point4D parameter.

Q3NURBCurve_GetKnot

You can use the Q3NURBCurve_GetKnot function to get a knot of a NURB curve.

TQ3Status Q3NURBCurve_GetKnot (
                     TQ3GeometryObject curve,
                     unsigned long knotIndex,
                     float *knotValue);
curve
A NURB curve.
knotIndex
An index into the knots array for the specified NURB curve.
knotValue
On exit, the value of the specified knot of the specified NURB curve.

DESCRIPTION

The Q3NURBCurve_GetKnot function returns, in the knotValue parameter, the value of the knot having the index specified by the knotIndex parameter in the knots array of the NURB curve specified by the curve parameter.

Q3NURBCurve_SetKnot

You can use the Q3NURBCurve_SetKnot function to set a knot of a NURB curve.

TQ3Status Q3NURBCurve_SetKnot (
                     TQ3GeometryObject curve,
                     unsigned long knotIndex,
                     float knotValue);
curve
A NURB curve.
knotIndex
An index into the knots array of knots for the specified NURB curve.
knotValue
The desired value of the specified knot of the specified NURB curve.

DESCRIPTION

The Q3NURBCurve_SetKnot function sets the value of the knot having the index specified by the knotIndex parameter in the knots array of the NURB curve specified by the curve parameter to the value specified in the knotValue parameter.


© 1997 Apple Computer, Inc.

Previous | QD3D Book | Overview | Chapter Contents | Next